﻿using Castle.Facilities.TypedFactory;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Yama.HelloWorld.Dao;
using Yama.HelloWorld.Dao.NHibernate;

namespace Yama.HelloWorld.Web.Installers
{
    public class RepositoriesInstaller : IWindsorInstaller
    {
        #region Implementation of IWindsorInstaller

        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.AddFacility<TypedFactoryFacility>();
            container.Register(Component.For<IVisitDao>().ImplementedBy<VisitDao>());
            container.Register(Component.For<IRepositoryFactory>().AsFactory());
        }

        #endregion
    }
}